<?php

	/**
	 * Defines a class used for querying the database using
	 * POP objects as base.
	 * It supports, basically, PostgreSQL, MySQL, MSSQL and
	 * Oracle databases.
	 * 
	 * @author Pablo Santiago Sánchez <phackwer@gmail.com>
	 * @copyright Copyright (c) 2008, Pablo Santiago Sánchez
	 * @license http://opensource.org/licenses/bsd-license.php BSD License
	 * @package pop
	 * @subpackage core
	 */

	/**
	 * Class used as base for all persistent objects created under
	 * the POP paradigm
	 * 
	 * @package pop
	 * @subpackage core
	 */
	abstract class POPQuery extends POPCore
	{
		/**
		 * Multidimension array populated after prepareStatement containing:
		 * [Object_name]
		 * 		[alias]
		 * 		[dbsourcename]
		 * 		[fields_from_this_object]
		 * [Object_name]
		 * 		[alias]
		 * 		[dbsourcename]
		 * 		[fields_from_this_object]
		 * 
		 * @var array
		 */
		private $querystruct;
		
		/**
		 * Name of the table on from (only one allowed!
		 * inner and left joins MUST be declared!
		 *  
		 * @var string
		 */
		private $mainsource;
		
		/**
		 * Name of the objects for inner join
		 * 
		 * @var array strings
		 */
		private $innersources;
		
		/**
		 * Name of the objects for left join
		 * 
		 * @var array strings
		 */
		private $leftsources;
		
		/**
		 * Inner flag to check if we have different
		 * dbs for inner or left joins,
		 * meaning we'll have multiple SQLs
		 * and the need to proccess the join on PHP
		 * 
		 * @var bool
		 */
		private $hasdifferentDBs = false;
		
		public function select(){}
		public function from(){}
		public function innerJoin(){}
		public function leftJoin(){}
		public function where(){}
		public function groupby(){}
		public function orderby(){}
		public function execute(){}
		
		private function prepareStatements(){}
		
		private function prepareSelect(){}
		private function prepareFrom(){}
		private function prepareInner(){}
		private function prepareLeft(){}
		private function prepareWhere(){}
		private function prepareGroup(){}
		private function prepareOrder(){}
		
		private function processResult(){}
		
		private function processInner(){}
		private function processLeft(){}
		private function processWhere(){}
		private function processGroup(){}
		private function processOrder(){}
	}
	
?>